/**************************
 * \if English
 * @Date:2018.09.10
 * @Author:
 * @Brief:
 * @Detail:
 * @Editor:
 * @Brief:
 * \else
 *
 * @创建日期：2018年9月10日
 * @作者：hualei
 * @大概功能：MOVE_MAG指令
**************************/
#include "moveMagInstruction.h"

MoveMagInstruction::MoveMagInstruction()
{
}
QDataStream& operator <<(QDataStream &out, MoveMagInstruction &myVector)
{
    out << (quint32)myVector.instructionType << (quint32)myVector.moveMagDirectionLMR <<
        (quint32)myVector.moveMagDirectionFB << myVector.velocityRatio << myVector.rfidInternalValue <<
           (quint32)myVector.stopType << myVector.stopInputNum << myVector.noteStr;

    return out;
}

QDataStream& operator >>(QDataStream &in, MoveMagInstruction &myVector)
{
    quint32 instructionType;
    quint32 moveMagDirectionLMR;
    quint32 moveMagDirectionFB;
    quint32 stopType;

    in >> instructionType >> moveMagDirectionLMR >> moveMagDirectionFB >> myVector.velocityRatio >>
           myVector.rfidInternalValue >> stopType >> myVector.stopInputNum >>myVector.noteStr;

    myVector.instructionType = (INSTRUCTION_TYPE)instructionType;
    myVector.moveMagDirectionLMR = (E_MOVE_MAG_LMR_TYPE)moveMagDirectionLMR;
    myVector.moveMagDirectionFB = (E_MOVE_MAG_FB_TYPE)moveMagDirectionFB;
    myVector.stopType = (E_MOVE_MAG_STOP_TYPE)stopType;

    return in;
}
